package com.hsh.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 *
 * @author 黄思海
 * @date 2021/7/4
 */
@Component
public class TaskDetails {
    private Logger logger = LoggerFactory.getLogger(getClass());
    private int i;
//                   秒，分，时，日，月，周  --> validation
//    @Scheduled(cron = "* * 17 5-6 5 ?")
    @Scheduled(cron = "*/5 1 23 1-8 7 ?")
    public void execute() {
        logger.info("thread id:{},FixedPrintTask execute times:{}", Thread.currentThread().getId(), ++i);
    }

}
